Encountering a series of errors (failures) is common in computer program code. A series of errors may occur when some original error leads to subsequent failures. This can occur in synchronous code if the original error is caught and re-thrown. This can also occur in asynchronous code if an asynchronous routine fails and thus causes handlers hooked into that asynchronous routine's completion to fail as well.
Many programming languages like JavaScript® provide some built-in functionality for error handling. For example, JavaScript® provides the Error type and try and catch statements, which facilitate the throwing of an Error instance. While very useful in many instances, with a complex series of errors the built-in error handling functionality is often insufficient for diagnosing a problem and surfacing it correctly to the end user.
For example, if one function call fails (due to a bug or exceptional condition), then a series of functions and components may fail. It is often not clear which failure in this chain of failures should take precedence and be shown to the end user. Additionally, the initial error that caused the series of errors and the asynchronous call graph (failure chain/graph) can be difficult to determine.